# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python2-construct
pkgver=2.9.45
pkgrel=5
pkgdesc='A powerful declarative parser/builder for binary data.'
arch=('any')
license=('MIT')
url='https://github.com/construct/construct/'
depends=('python2')
makedepends=('python2-setuptools')
checkdepends=('python2-arrow' 'python-numpy' 'python-pytest-runner'
              'python-pytest-benchmark')
optdepends=('python2-arrow: for Timestamp'
            'python2-numpy: for array serialization with Numpy protocol')
source=("$pkgname-$pkgver.tar.gz::https://github.com/construct/construct/archive/v$pkgver.tar.gz")
sha512sums=('78d64f3e567e6c9cef842d3e15f416d48856d229a8c6f21e282d3123a86fdd243b20dba5040c6e1d28b67422881351b303262132263efdf94bb73adde0d5dfc1')

build() {
  cd "construct-$pkgver"

  python2 setup.py build
}

package() {
  cd "construct-$pkgver"

  python2 setup.py install --root="$pkgdir" --optimize=1

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

